/*--------------------------------------------------------------------------------------*\
**
** adv_object_list_image.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#ifndef ADV_OBJECT_LIST_IMAGE_H_INCLUDED
#define ADV_OBJECT_LIST_IMAGE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#pragma warning( disable: 4786 )

#include <string>

#include "abstract_town.h"
#include "adventure_map.h"
#include "adventure_object_ptr.h"
#include "bitmap_group.h"
#include "bitmap_group_cache.h"
#include "bitmap_group_ptr.h"
#include "bitmap_layer_ptr.h"
#include "bitmap_layer_cache_window.h"
#include "buffer_window.h"
#include "micro_map_renderer_ptr.h"
#include "shared_ptr.h"

class   t_adv_dwelling;
class	t_micro_map_renderer;
struct	t_screen_point;
enum    t_town_building;

// --------------------------------------------------
// object to create a thumbnail image of the town
// or other adventure object
// --------------------------------------------------
class t_adv_object_list_image
{
public:
	// Size of thumbnails we are drawing
	enum t_mode
	{
		k_mode_tiny = 0,
		k_mode_caravan,

		k_mode_count
	};

	t_adv_object_list_image( t_mode mode = k_mode_tiny );

	t_image_buffer const&	get_bitmap();
	t_micro_map_renderer&	get_map_renderer( t_adventure_map const& map,
											  int team_view,
											  t_screen_point const& view_size,
											  t_bitmap_layer_ptr object_marker );
	void					set_dwelling( t_adv_dwelling * dwelling );
	void					set_town( t_town * town );
protected:
	void                  create_renderer( t_adventure_map const& map,
										   int team_view,
										   t_screen_point const& view_size,
										   t_bitmap_layer_ptr object_marker );
	void                  draw_bar( std::string dest_layer_name,
									std::string source_layer_name,
									t_town * town,
									t_town_building const* buildings, int count, int limit );

	t_bitmap_group_ptr			m_bar_graphs;
	std::string					m_building_keyword;
	t_town_building_set			m_drawn_buildings;
	t_image_buffer				m_image;
	t_micro_map_renderer_ptr	m_map_renderer;
	t_mode						m_mode;
	t_adventure_object_ptr		m_object;
	t_bitmap_group_ptr			m_thumbnails;
	t_terrain_type				m_terrain;
};

#endif //ADV_OBJECT_LIST_IMAGE_H_INCLUDED


